/*
 * 创建人： Created by  on 2020/12/3.
 * 创建时间：Created by  on 2020/12/3.
 * 页面说明：
 * 可关注公众号：我的大前端生涯   获取最新技术分享
 * 可关注网易云课堂：https://study.163.com/instructor/1021406098.htm
 * 可关注博客：https://blog.csdn.net/zl18603543572
 */

class StudyDataBean {
  int id;
  String videoName;
  String videoInfo;
  String createTime;
  int materialNumber;

  /// 课件类型 0 视频 1 PPT 2 Word
  int videoTypes;

  String videoUrl;

  List<StudyItemDataBean> itemList = [];

  ///常用用于解析JSON数据
  StudyDataBean.fromMap(Map<String, dynamic> map) {
    if (map != null) {
      this.videoName = map["videoName"] ?? "--";
      this.videoUrl = map["videoUrl"] ?? "";
      this.videoInfo = map["videoInfo"] ?? "--";
      this.createTime = map["createTime"] ?? "--";
      this.videoTypes = map["videoTypes"] ?? 0;
      this.materialNumber = map["materialNumber"] ?? 0;

      this.id = map["id"] ?? 0;

      var materialItemEntityList = map["materialItemEntityList"];
      if (materialItemEntityList != null && materialItemEntityList is List) {
        List<StudyItemDataBean> themList = [];
        for (int i = 0; i < materialItemEntityList.length; i++) {
          themList.add(StudyItemDataBean.fromMap(materialItemEntityList[i]));
        }
        itemList = themList;
      }
    }
  }
}

class StudyItemDataBean {
  int id;
  String materialContent;

  ///常用用于解析JSON数据
  StudyItemDataBean.fromMap(Map<String, dynamic> map) {
    if (map != null) {
      this.materialContent = map["materialContent"] ?? "--";
      this.id = map["id"] ?? 0;
    }
  }
}

class MaterialCategoryBean {
  int id;
  String categoryName;

  MaterialCategoryBean.fromMap(Map<String, dynamic> map) {
    if (map != null) {
      this.categoryName = map["categoryName"] ?? "--";
      this.id = map["id"] ?? 0;
    }
  }
}
